package com.chapter08;

import com.alibaba.druid.pool.DruidDataSourceFactory;

import javax.sql.DataSource;
import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.util.Properties;

public class Test04_druid {
    public static void main(String[] args) throws Exception {
        Properties properties = new Properties();
        InputStream inputStream = Test04_druid.class.getClassLoader()
                .getResourceAsStream("druid.properties");

        properties.load(inputStream);

        DataSource dataSource = DruidDataSourceFactory.createDataSource(properties);

        Connection connection = dataSource.getConnection();
        System.out.println(connection);

    }
}
